/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upn.sigemfi.vnf.bc;

import edu.upn.sigemfi.vnf.be.Giro;
import edu.upn.sigemfi.vnf.be.OrdenPagoT;
import edu.upn.sigemfi.vnf.be.ServicioGeneral;
import edu.upn.sigemfi.vnf.be.ServicioInstitucional;
import edu.upn.sigemfi.vnf.be.TransaccionNoFinanciera;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Administrador
 */
@Stateless
public class TransaccionNoFinancieraFacade implements TransaccionNoFinancieraFacadeLocal {
    //@PersistenceUnit(name="edu.upn.sigemfi.vnf-ejbPU")

    @PersistenceContext
    private EntityManager em;

    public void create(TransaccionNoFinanciera transaccionNoFinanciera) {
        em.persist(transaccionNoFinanciera);
    }

    public void edit(TransaccionNoFinanciera transaccionNoFinanciera) {
        em.merge(transaccionNoFinanciera);
    }

    public void remove(TransaccionNoFinanciera transaccionNoFinanciera) {
        em.remove(em.merge(transaccionNoFinanciera));
    }

    public TransaccionNoFinanciera find(Object id) {
        return em.find(TransaccionNoFinanciera.class, id);
    }

    public List<TransaccionNoFinanciera> findAll() {
        return em.createQuery("select object(o) from TransaccionNoFinanciera as o").getResultList();
    }

    public Giro findGiro(Object id) {
        return em.find(Giro.class, id);
    }

    public List<Giro> findAllGiros() {
        return em.createQuery("select object(o) from Giro as o").getResultList();
    }

     public OrdenPagoT findOrdenPago(Object id) {
        return em.find(OrdenPagoT.class,id);
    }

    public List<OrdenPagoT> findAllOrdenPago() {
        return em.createQuery("select object(o) from OrdenPagoT as o").getResultList();
    }


     public ServicioGeneral findServicioGeneral(Object id) {
        return em.find(ServicioGeneral.class,id);
    }

    public List<ServicioGeneral> findAllServicioGenerales() {
        return em.createQuery("select object(o) from ServicioGeneral as o").getResultList();
    }

     public ServicioInstitucional findServicioInstitucional(Object id) {
        return em.find(ServicioInstitucional.class,id);
    }

    public List<ServicioInstitucional> findAllServicioInstitucionales() {
        return em.createQuery("select object(o) from ServicioInstitucional as o").getResultList();
    }
}
